package com.example.demo2.entity;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@ExcelIgnoreUnannotated
@EqualsAndHashCode
@ContentRowHeight(20)
@HeadRowHeight(20)
@ColumnWidth(20)
@TableName("sys_place")
public class ShopPlace {
    @TableId(type = IdType.AUTO)
    @ExcelProperty(value = "编号")
    private Integer id;
    @ExcelProperty(value = "商品名称")
    private String name;
    private Integer provinceCode;
    private Integer countyCode;
    private Integer cityCode;
    @ExcelProperty(value = "所在城市")
    private String completeCity;
    @ExcelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @ExcelProperty(value = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @ExcelProperty(value = "开始营业时间")
    private String openTime;
    @ExcelProperty(value = "结束营业时间")
    private String closeTime;
    @ColumnWidth(60)
    @ExcelProperty(value = "封面图片")
    private String coverImg;
    @ExcelProperty(value = "寄放行李箱价格")
    @TableField("big_pake_price")
    private String bigPakePrice;
    @ExcelProperty(value = "寄放背包价格")
    @TableField("middle_pake_price")
    private String middlePakePrice;
    private String longitude;
    private String latitude;
    @ExcelProperty(value = "地址描述")
    @ColumnWidth(60)
    @TableField("ctiy_description")
    private String ctiyDescription;
//    由于 isDelete 添加了 @TableLogic 注解，MyBatis Plus 做所有查询操作时，自动会在 where 条件后面拼上 is_del = 0，所以 is_del 置一后，实现了逻辑删除
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) //逻辑删除不返回给前端
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
